import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 第三方信息管理信息 */
export interface ThirdPartyInformation {
          id: number; // id
          thirdPartyId: string; // 第三方id
          title: string; // 标题
          infoType: string; // 信息类型
          category: string; // 行业
          area: string; // 地区
          publishDate: string; // 公布时间
          description?: string; // 正文
  }

// 第三方信息管理 API
export const ThirdPartyInformationApi = {
  // 查询第三方信息管理分页
  getThirdPartyInformationPage: async (params: any) => {
    return await request.get({ url: `/biz/third-party-information/page`, params })
  },

  // 查询第三方信息管理详情
  getThirdPartyInformation: async (id: number) => {
    return await request.get({ url: `/biz/third-party-information/get?id=` + id })
  },

  // 新增第三方信息管理
  createThirdPartyInformation: async (data: ThirdPartyInformation) => {
    return await request.post({ url: `/biz/third-party-information/create`, data })
  },

  // 修改第三方信息管理
  updateThirdPartyInformation: async (data: ThirdPartyInformation) => {
    return await request.put({ url: `/biz/third-party-information/update`, data })
  },

  // 删除第三方信息管理
  deleteThirdPartyInformation: async (id: number) => {
    return await request.delete({ url: `/biz/third-party-information/delete?id=` + id })
  },

  /** 批量删除第三方信息管理 */
  deleteThirdPartyInformationList: async (ids: number[]) => {
    return await request.delete({ url: `/biz/third-party-information/delete-list?ids=${ids.join(',')}` })
  },

  // 导出第三方信息管理 Excel
  exportThirdPartyInformation: async (params) => {
    return await request.download({ url: `/biz/third-party-information/export-excel`, params })
  },
}